<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>qredisclient: /home/maker/projects/rdm/3rdparty/qredisclient/src/qredisclient/command.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">qredisclient
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_1bcd59b52529ede8481d9843c654718a.html">qredisclient</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">command.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &lt;functional&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;QString&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;QByteArray&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;QList&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;QObject&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_redis_client.html">RedisClient</a> {</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keyword">class </span>Response;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_redis_client_1_1_command.html">   18</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_redis_client_1_1_command.html">Command</a> </div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;{    </div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="keyword">typedef</span> std::function&lt;void(Response, QString)&gt; Callback;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <a class="code" href="class_redis_client_1_1_command.html#af803b3f39fcd40971d1856c133a67c2b">Command</a>();</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <a class="code" href="class_redis_client_1_1_command.html#af803b3f39fcd40971d1856c133a67c2b">Command</a>(<span class="keyword">const</span> QList&lt;QByteArray&gt;&amp; cmd, <span class="keywordtype">int</span> db = -1);</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <a class="code" href="class_redis_client_1_1_command.html#af803b3f39fcd40971d1856c133a67c2b">Command</a>(<span class="keyword">const</span> QList&lt;QByteArray&gt;&amp; cmd, QObject * context, Callback callback, <span class="keywordtype">int</span> db = -1);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_redis_client_1_1_command.html#ac92db47918b797fcc6a12dc39ba0b795">~Command</a>();</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="class_redis_client_1_1_command.html">Command</a> &amp;<a class="code" href="class_redis_client_1_1_command.html#a414617f1edd3dcc4756f060846ece48c">append</a>(<span class="keyword">const</span> QByteArray&amp; part);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    QByteArray  <a class="code" href="class_redis_client_1_1_command.html#a11fc33153ef811085df55ce005ae4238">getByteRepresentation</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    QByteArray <a class="code" href="class_redis_client_1_1_command.html#a0df5d27557e972c9b38cf7cf780bb6b2">getRawString</a>(<span class="keywordtype">int</span> limit=200) <span class="keyword">const</span>;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    QList&lt;QByteArray&gt; <a class="code" href="class_redis_client_1_1_command.html#a623043488e186dd65089ffa65a76bd84">getSplitedRepresentattion</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    QString <a class="code" href="class_redis_client_1_1_command.html#a2efd7b57d28d46a0a5a79b58e90768b9">getPartAsString</a>(<span class="keywordtype">int</span> i);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_redis_client_1_1_command.html#a3e6bb365c775b344c0724ec1f45c809f">getDbIndex</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_redis_client_1_1_command.html#aa586a20d499e33ecdc8962174fb7e099">hasDbIndex</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    QObject* <a class="code" href="class_redis_client_1_1_command.html#a8ca57f14ace34bb7e6782aeb92017b76">getOwner</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_redis_client_1_1_command.html#a0e85031f53252b280f04188e3684740c">setCallBack</a>(QObject* context, Callback callback);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    Callback <a class="code" href="class_redis_client_1_1_command.html#a4bc09f62e829db4a834676f2b3b5b272">getCallBack</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_redis_client_1_1_command.html#ae6b2467afe7b802669b3ea81733abd3b">hasCallback</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_redis_client_1_1_command.html#aa676b67844daa151a53b562b8d14ecaa">markAsHiPriorityCommand</a>();</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_redis_client_1_1_command.html#ae1d2524480734ad60be734ea9d30ee3a">isHiPriorityCommand</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_redis_client_1_1_command.html#a2d96fd461b48e784f8fc425b023653d2">isValid</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keywordtype">bool</span> isEmpty() <span class="keyword">const</span>;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="comment">/*</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="comment">     * Command type checks</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="comment">     */</span></div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="keywordtype">bool</span> isScanCommand() <span class="keyword">const</span>;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keywordtype">bool</span> isSelectCommand() <span class="keyword">const</span>;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordtype">bool</span> isSubscriptionCommand() <span class="keyword">const</span>;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordtype">bool</span> isUnSubscriptionCommand() <span class="keyword">const</span>;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keyword">static</span> QList&lt;QByteArray&gt; <a class="code" href="class_redis_client_1_1_command.html#a36d4f65e3a25d3b06c68d43b693894d5">splitCommandString</a>(<span class="keyword">const</span> QString &amp;);</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    QObject * m_owner;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    QList&lt;QByteArray&gt; m_commandWithArguments;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordtype">int</span> m_dbIndex;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordtype">bool</span> m_hiPriorityCommand;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    Callback m_callback;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;};</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;}</div><div class="ttc" id="namespace_redis_client_html"><div class="ttname"><a href="namespace_redis_client.html">RedisClient</a></div><div class="ttdef"><b>Definition:</b> command.h:8</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html"><div class="ttname"><a href="class_redis_client_1_1_command.html">RedisClient::Command</a></div><div class="ttdoc">The Command class. </div><div class="ttdef"><b>Definition:</b> command.h:18</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a623043488e186dd65089ffa65a76bd84"><div class="ttname"><a href="class_redis_client_1_1_command.html#a623043488e186dd65089ffa65a76bd84">RedisClient::Command::getSplitedRepresentattion</a></div><div class="ttdeci">QList&lt; QByteArray &gt; getSplitedRepresentattion() const </div><div class="ttdoc">Get source command as list of args. </div><div class="ttdef"><b>Definition:</b> command.cpp:155</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_ae1d2524480734ad60be734ea9d30ee3a"><div class="ttname"><a href="class_redis_client_1_1_command.html#ae1d2524480734ad60be734ea9d30ee3a">RedisClient::Command::isHiPriorityCommand</a></div><div class="ttdeci">bool isHiPriorityCommand() const </div><div class="ttdoc">isHiPriorityCommand </div><div class="ttdef"><b>Definition:</b> command.cpp:133</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a0df5d27557e972c9b38cf7cf780bb6b2"><div class="ttname"><a href="class_redis_client_1_1_command.html#a0df5d27557e972c9b38cf7cf780bb6b2">RedisClient::Command::getRawString</a></div><div class="ttdeci">QByteArray getRawString(int limit=200) const </div><div class="ttdoc">Get source command as single string. </div><div class="ttdef"><b>Definition:</b> command.cpp:148</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a414617f1edd3dcc4756f060846ece48c"><div class="ttname"><a href="class_redis_client_1_1_command.html#a414617f1edd3dcc4756f060846ece48c">RedisClient::Command::append</a></div><div class="ttdeci">Command &amp; append(const QByteArray &amp;part)</div><div class="ttdoc">Append additional arg/part to command (&quot;SET 1&quot; + &quot;2&quot;) </div><div class="ttdef"><b>Definition:</b> command.cpp:30</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a2efd7b57d28d46a0a5a79b58e90768b9"><div class="ttname"><a href="class_redis_client_1_1_command.html#a2efd7b57d28d46a0a5a79b58e90768b9">RedisClient::Command::getPartAsString</a></div><div class="ttdeci">QString getPartAsString(int i)</div><div class="ttdoc">Get specific argument/part of the command. </div><div class="ttdef"><b>Definition:</b> command.cpp:160</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a11fc33153ef811085df55ce005ae4238"><div class="ttname"><a href="class_redis_client_1_1_command.html#a11fc33153ef811085df55ce005ae4238">RedisClient::Command::getByteRepresentation</a></div><div class="ttdeci">QByteArray getByteRepresentation() const </div><div class="ttdoc">Get command in RESP format. </div><div class="ttdef"><b>Definition:</b> command.cpp:173</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_aa676b67844daa151a53b562b8d14ecaa"><div class="ttname"><a href="class_redis_client_1_1_command.html#aa676b67844daa151a53b562b8d14ecaa">RedisClient::Command::markAsHiPriorityCommand</a></div><div class="ttdeci">void markAsHiPriorityCommand()</div><div class="ttdoc">Mark this command as High Priority command. Command will be added to the begining of the Connection q...</div><div class="ttdef"><b>Definition:</b> command.cpp:189</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_ac92db47918b797fcc6a12dc39ba0b795"><div class="ttname"><a href="class_redis_client_1_1_command.html#ac92db47918b797fcc6a12dc39ba0b795">RedisClient::Command::~Command</a></div><div class="ttdeci">virtual ~Command()</div><div class="ttdoc">~Command </div><div class="ttdef"><b>Definition:</b> command.cpp:26</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a3e6bb365c775b344c0724ec1f45c809f"><div class="ttname"><a href="class_redis_client_1_1_command.html#a3e6bb365c775b344c0724ec1f45c809f">RedisClient::Command::getDbIndex</a></div><div class="ttdeci">int getDbIndex() const </div><div class="ttdoc">Get database index where this command should be executed. </div><div class="ttdef"><b>Definition:</b> command.cpp:138</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a4bc09f62e829db4a834676f2b3b5b272"><div class="ttname"><a href="class_redis_client_1_1_command.html#a4bc09f62e829db4a834676f2b3b5b272">RedisClient::Command::getCallBack</a></div><div class="ttdeci">Callback getCallBack() const </div><div class="ttdoc">getCallBack </div><div class="ttdef"><b>Definition:</b> command.cpp:97</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_aa586a20d499e33ecdc8962174fb7e099"><div class="ttname"><a href="class_redis_client_1_1_command.html#aa586a20d499e33ecdc8962174fb7e099">RedisClient::Command::hasDbIndex</a></div><div class="ttdeci">bool hasDbIndex() const </div><div class="ttdoc">hasDbIndex </div><div class="ttdef"><b>Definition:</b> command.cpp:102</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_ae6b2467afe7b802669b3ea81733abd3b"><div class="ttname"><a href="class_redis_client_1_1_command.html#ae6b2467afe7b802669b3ea81733abd3b">RedisClient::Command::hasCallback</a></div><div class="ttdeci">bool hasCallback() const </div><div class="ttdoc">hasCallback </div><div class="ttdef"><b>Definition:</b> command.cpp:86</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a36d4f65e3a25d3b06c68d43b693894d5"><div class="ttname"><a href="class_redis_client_1_1_command.html#a36d4f65e3a25d3b06c68d43b693894d5">RedisClient::Command::splitCommandString</a></div><div class="ttdeci">static QList&lt; QByteArray &gt; splitCommandString(const QString &amp;)</div><div class="ttdoc">Parse command from raw string. Useful for CLI clients. </div><div class="ttdef"><b>Definition:</b> command.cpp:36</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_af803b3f39fcd40971d1856c133a67c2b"><div class="ttname"><a href="class_redis_client_1_1_command.html#af803b3f39fcd40971d1856c133a67c2b">RedisClient::Command::Command</a></div><div class="ttdeci">Command()</div><div class="ttdoc">Constructs empty command. </div><div class="ttdef"><b>Definition:</b> command.cpp:7</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a8ca57f14ace34bb7e6782aeb92017b76"><div class="ttname"><a href="class_redis_client_1_1_command.html#a8ca57f14ace34bb7e6782aeb92017b76">RedisClient::Command::getOwner</a></div><div class="ttdeci">QObject * getOwner() const </div><div class="ttdoc">Get callback context. </div><div class="ttdef"><b>Definition:</b> command.cpp:143</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a2d96fd461b48e784f8fc425b023653d2"><div class="ttname"><a href="class_redis_client_1_1_command.html#a2d96fd461b48e784f8fc425b023653d2">RedisClient::Command::isValid</a></div><div class="ttdeci">bool isValid() const </div><div class="ttdoc">isValid </div><div class="ttdef"><b>Definition:</b> command.cpp:194</div></div>
<div class="ttc" id="class_redis_client_1_1_command_html_a0e85031f53252b280f04188e3684740c"><div class="ttname"><a href="class_redis_client_1_1_command.html#a0e85031f53252b280f04188e3684740c">RedisClient::Command::setCallBack</a></div><div class="ttdeci">void setCallBack(QObject *context, Callback callback)</div><div class="ttdoc">Set context and callback. </div><div class="ttdef"><b>Definition:</b> command.cpp:91</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
